Skip to content

fix: Resolve app not running on non web platforms#20

Merged
mcquenji merged 3 commits intomainfrom
lpa-45
Mar 22, 2025
Merged

fix: Resolve app not running on non web platforms#20
mcquenji merged 3 commits intomainfrom
lpa-45

Conversation

@mcquenji
Copy link
Contributor

@mcquenji mcquenji commented Mar 14, 2025

This pull request includes several enhancements and bug fixes primarily focused on improving the authentication and authorization mechanisms, as well as optimizing repository refresh operations.

Authentication and Authorization Enhancements:

  • Added logging to AuthGuard and CapabilityGuard to provide better insights into authentication and capability checks (lib/src/auth/presentation/guards/auth_guard.dart, lib/src/auth/presentation/guards/capability_guard.dart) [1] [2].
  • Modified AuthRepository to return a boolean on authentication success and added a requireAuth method to ensure the user is authenticated (lib/src/auth/presentation/repositories/auth_repository.dart) [1] [2].
  • Updated the LoginScreen and LoginForm to handle successful login via a callback (lib/src/auth/presentation/screens/login_screen.dart, lib/src/auth/presentation/widgets/login_form.dart) [1] [2].

Repository Refresh Optimization:

  • Replaced build method calls with refresh in various repository classes to improve data consistency and performance (lib/src/calendar/presentation/repositories/calendar_plan_repository.dart, lib/src/calendar/presentation/repositories/invites_repository.dart, lib/src/moodle/presentation/guards/has_courses_guard.dart, lib/src/slots/presentation/repositories/slot_master_slots_repository.dart, lib/src/slots/presentation/repositories/slots_repository.dart) [1] [2] [3] [4] [5].

Other Notable Changes:

  • Improved guard order and added necessary guards to child routes in AppModule to ensure proper access control and avoiding infinite redirects (lib/src/app/app.dart) [1] [2] [3].
  • Enhanced user capability logging and error handling in CapabilityGuard (lib/src/auth/presentation/guards/capability_guard.dart).
  • Updated UserRepository to check for authentication state directly and improve user data handling (lib/src/auth/presentation/repositories/user_repository.dart) [1] [2].

Fixed some race conditions resulting in infinite redirects. Idk why this was working on web but not on desktop tho...
@necodeit
Copy link

necodeit bot commented Mar 14, 2025

Analysis Report for c98a593

  • Infos: 16
  • Warnings: 0
  • Errors: 5
Click to see the full report
error • Only classes and mixins can be used as superclass constraints • lib/src/app/utils/sentry_utils.dart:24:19 • mixin_super_class_constraint_non_interface
error • Undefined class 'ILoggable' • lib/src/app/utils/sentry_utils.dart:24:19 • undefined_class
error • Undefined name 'namespace' • lib/src/app/utils/sentry_utils.dart:34:36 • undefined_identifier
error • Undefined name 'namespace' • lib/src/app/utils/sentry_utils.dart:37:13 • undefined_identifier
error • Undefined name 'namespace' • lib/src/app/utils/sentry_utils.dart:39:36 • undefined_identifier
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/auth/presentation/repositories/auth_repository.dart:24:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/auth/presentation/repositories/echidna_user_repository.dart:18:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/auth/presentation/repositories/user_repository.dart:28:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/calendar/presentation/repositories/calendar_plan_repository.dart:42:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/calendar/presentation/repositories/invites_repository.dart:23:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/moodle/presentation/repositories/moodle_courses_repository.dart:21:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/moodle/presentation/repositories/moodle_tasks_repository.dart:27:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/moodle/presentation/repositories/users_repository.dart:23:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/notifications/presentation/repositories/notifications_repository.dart:28:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/slot_master_courses_repository.dart:24:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/slot_master_slots_repository.dart:27:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/slots_repository.dart:30:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/supervisor_slots_repository.dart:24:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/statistics/presentation/repositories/course_stats_repository.dart:24:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/statistics/presentation/repositories/global_stats_repository.dart:20:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/theming/presentation/repositories/theme_repository.dart:28:24 • deprecated_member_use

View annotated files

@necodeit
Copy link

necodeit bot commented Mar 14, 2025

Analysis Report for c98a593

  • Infos: 16
  • Warnings: 0
  • Errors: 5
Click to see the full report
error • Only classes and mixins can be used as superclass constraints • lib/src/app/utils/sentry_utils.dart:24:19 • mixin_super_class_constraint_non_interface
error • Undefined class 'ILoggable' • lib/src/app/utils/sentry_utils.dart:24:19 • undefined_class
error • Undefined name 'namespace' • lib/src/app/utils/sentry_utils.dart:34:36 • undefined_identifier
error • Undefined name 'namespace' • lib/src/app/utils/sentry_utils.dart:37:13 • undefined_identifier
error • Undefined name 'namespace' • lib/src/app/utils/sentry_utils.dart:39:36 • undefined_identifier
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/auth/presentation/repositories/auth_repository.dart:24:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/auth/presentation/repositories/echidna_user_repository.dart:18:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/auth/presentation/repositories/user_repository.dart:28:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/calendar/presentation/repositories/calendar_plan_repository.dart:42:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/calendar/presentation/repositories/invites_repository.dart:23:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/moodle/presentation/repositories/moodle_courses_repository.dart:21:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/moodle/presentation/repositories/moodle_tasks_repository.dart:27:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/moodle/presentation/repositories/users_repository.dart:23:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/notifications/presentation/repositories/notifications_repository.dart:28:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/slot_master_courses_repository.dart:24:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/slot_master_slots_repository.dart:27:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/slots_repository.dart:30:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/slots/presentation/repositories/supervisor_slots_repository.dart:24:22 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/statistics/presentation/repositories/course_stats_repository.dart:24:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/statistics/presentation/repositories/global_stats_repository.dart:20:24 • deprecated_member_use
info • 'BuildTrigger' is deprecated and shouldn't be used. BuildTrigger has been renamed to Trigger • lib/src/theming/presentation/repositories/theme_repository.dart:28:24 • deprecated_member_use

View annotated files

@necodeit
Copy link

necodeit bot commented Mar 14, 2025

Analysis Report for 3498527

  • Infos: 0
  • Warnings: 0
  • Errors: 0
Click to see the full report
No issues found! (ran in 33.9s)

View annotated files

@mcquenji mcquenji changed the title fix: Enable non web platforms fix: Resolve app not running on non web platforms Mar 14, 2025
@necodeit
Copy link

necodeit bot commented Mar 14, 2025

Analysis Report for 3498527

  • Infos: 0
  • Warnings: 0
  • Errors: 0
Click to see the full report
No issues found! (ran in 35.3s)

View annotated files

Copy link
Contributor

@RiedleroD RiedleroD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does this when I try to log into our test moodle server; pressing on "return to home" opens the correct page incl. "beta test" popup

image

@necodeit
Copy link

necodeit bot commented Mar 15, 2025

Analysis Report for ab60f94

  • Infos: 0
  • Warnings: 0
  • Errors: 0
Click to see the full report
No issues found! (ran in 33.8s)

View annotated files

@RiedleroD
Copy link
Contributor

when clicking on calendar view, it throws me into settings (what?)

@mcquenji
Copy link
Contributor Author

unreleated to this PR

Copy link
Contributor

@RiedleroD RiedleroD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well ok then I guess it works

Copy link
Contributor

@MasterMarcoHD MasterMarcoHD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on Arch WSL with no issues.

@mcquenji mcquenji merged commit 75977be into main Mar 22, 2025
2 of 3 checks passed
@mcquenji mcquenji deleted the lpa-45 branch March 22, 2025 12:57
@necodeit
Copy link

necodeit bot commented Oct 6, 2025

Analysis Report for ab60f94

  • Infos: 0
  • Warnings: 0
  • Errors: 0
Click to see the full report
No issues found! (ran in 34.3s)

View annotated files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants